<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:a4j="http://richfaces.org/a4j" 
      xmlns:rich="http://richfaces.org/rich"> 

<h:head></h:head> 
<body>

		<h:form id="myform">
			<rich:toolbar>
					<rich:dropDownMenu mode="ajax" label ="File">
							<rich:menuItem label="New" />
							<rich:menuItem label="Open File..." />
							<rich:menuItem label="Close" />
							<rich:menuItem label="Close All" />
					</rich:dropDownMenu>
					
					<rich:dropDownMenu mode="ajax" >
							<f:facet name="label">
							<h:outputText value="View" />
							</f:facet>
							<rich:menuItem label="Undo" />
					</rich:dropDownMenu>
					<rich:dropDownMenu mode="ajax" >
							<f:facet name="label">
							<h:outputText value="Company" />
							</f:facet>
							<rich:menuItem label="About" />
					</rich:dropDownMenu>
					<rich:dropDownMenu mode="ajax" >
							<f:facet name="label">
							<h:outputText value="Stocks" />
							</f:facet>
							<rich:menuItem label="About" />
					</rich:dropDownMenu>
					
					<rich:dropDownMenu mode="ajax" >
							<f:facet name="label">
							<h:outputText value="Help" />
							</f:facet>
							<rich:menuItem label="About" />
					</rich:dropDownMenu>
			</rich:toolbar>
	</h:form>	



	<rich:panel>
		<rich:toolbar itemSeparator="line" height="70x">
				
	            <h:graphicImage title="#{msgs.v1}" value="/resources/images/credit_cards_512.png" width="35" height="50" style=" height : 50px;"/>
				<h:graphicImage title="#{msgs.v2}"  value="/resources/images/checkout.png" width="35" height="50" style=" height : 50px;"/>
				<h:graphicImage title="#{msgs.v3}"  value="/resources/images/credit_cards_512.png" width="35" height="50" style=" height : 50px;"/>
				<h:graphicImage value="/resources/images/credit_cards_512.png" width="35" height="50" style=" height : 50px;"/>
				<h:graphicImage value="/resources/images/coins.png" width="35" height="50" style=" height : 50px;"/>
				<h:graphicImage value="/resources/images/credit_cards_512.png" width="35" height="50" style=" height : 50px;"/>
				<h:graphicImage value="/resources/images/credit_card.png" width="35" height="50" style=" height : 50px;"/>

				<h:graphicImage value="/resources/images/credit_cards_512.png" width="35" height="50" style=" height : 50px;"/>
				<h:graphicImage value="/resources/images/banknote.png" width="35" height="50" style=" height : 50px;"/>
				<h:graphicImage value="/resources/images/discount.png" width="35" height="50" style=" height : 50px;"/>
				<h:graphicImage value="/resources/images/credit_cards_512.png" width="35" height="50" style=" height : 50px;"/>
				<h:graphicImage value="/resources/images/personal_loan.png" width="35" height="50" style=" height : 50px;"/>
				<h:graphicImage value="/resources/images/full_shopping_cart_512.png" width="35" height="50" style=" height : 50px;"/>
				<h:graphicImage value="/resources/images/credit_cards_512.png" width="35" height="50" style=" height : 50px;"/>
				
					
		</rich:toolbar>
	</rich:panel>


    <rich:panel>
           		<rich:panel >
				       <f:facet name="header">
				             #{msgs.salesapp}
				       </f:facet> 
				       
				       
		<h:panelGrid columns="8">
				
								  
			<h:outputLabel value="الوصف" for="desc" />
            <h:inputText id="desc" value="#{bean2.sale.desc}" title="الوصف" />
            
            <h:outputLabel value="تاريخ الاستحقاق" for="date1" />       
            <rich:calendar id="date1" enableManualInput="true" value="#{bean2.sale.paymentRequiredDate}"/>
            
            <h:outputLabel value="التاريخ" for="date2" />       
            <rich:calendar id="date2" enableManualInput="true" currentDate="" datePattern="d/M/yy HH:mm"/>
            
            
            <h:outputLabel value="رقم القيد" for="reg_numb" />
            <h:inputText id="reg_numb" value="#{bean2.sale.recordNumber}" title="رقم القيد" />
            
            
            <h:outputLabel value="المندوب\ العميل" for="clints" />
            <rich:select value="" id="clints">
                 <f:selectItems value="#{bean2.sale.clients}" />
             </rich:select>
            
            <h:outputLabel value="الإجمالى" for="totalid" />            
			<h:inputText value="#{bean2.sale.total}" id="totalid">
				<f:convertNumber   pattern="00.00"  />
			</h:inputText>
			
			
			<h:outputLabel value="مندوب" for="clintid" />
            <rich:select value="" id="clintid">
                 <f:selectItems value="" />
             </rich:select>
  
 </h:panelGrid>
				       
<br/>

	<h:form>
				<rich:panel header="Sale Lines">
							<rich:dataTable value="#{bean2.salesLineslist}" var="line" rows="50" id="datatable">
							
										<rich:column>
												<f:facet name="header">مسلسل</f:facet>
												<rich:inputNumberSpinner  value="#{line.id}" />
										</rich:column>
										
										<rich:column>
												<f:facet name="header">الصنف</f:facet>
												
									           <rich:select enableManualInput="true" value="#{line.item}"
									                defaultLabel="اكتب اسم أو رقم الصنف">
									                <f:selectItems value="#{bean2.list}" />
									            </rich:select>
            
										</rich:column>
										
										<rich:column>
												<f:facet name="header">سعر الوحدة</f:facet>
												<h:inputText value="#{line.itemPrice}" >
													<f:convertNumber   pattern="$####.00"  />
												</h:inputText>
										</rich:column>
										
										<rich:column>
												<f:facet name="header">العدد</f:facet>
												<rich:inputNumberSpinner value="#{line.qty}"/>	
										</rich:column>
										
										
										<rich:column>
												<f:facet name="header">الباركود</f:facet>
												<h:inputText value="#{line.barcode}" >
												</h:inputText>
										</rich:column>
										
									
										<rich:column>
												<f:facet name="header">رقم الخط</f:facet>
												<h:inputText value="#{line.numberLine}" >
												</h:inputText>
										</rich:column>
											
											
										<rich:column>
												<f:facet name="header">الصافى</f:facet>
												<h:inputText value="#{line.net}" /> 
										</rich:column>
							
							</rich:dataTable>
				</rich:panel>

			<br/>
				
					
			<a4j:commandButton value="إلغاء"/>
				    <a4j:commandButton value="حفظ و جديد"/>
				    <a4j:commandButton value="حفظ و إغلاق"/>
					<a4j:commandButton value="حفظ و طباعة"/>
			     	<a4j:commandButton render="datatable" immediate="true" value="Add New Line" action="#{bean2.addNewLineInDataTable}"/>	
			
				</h:form>
					 
				</rich:panel>
				<br/>
				<br/>				
			<br/>
			<br/>
			<br/>	
				
    </rich:panel>
			
		<br/>
		
		
							
			
</body> 
</html>


